<?php
$awal = datefmysql($params['awal']);
$akhir = datefmysql($params['akhir']);
$namaFile = 'collecting_day.xls';

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");

// header untuk nama file
header("Content-Disposition: attachment;
                filename=".$namaFile."");

header("Content-Transfer-Encoding: binary ");
?>
<html>
    <head>
        <title>Cetak Laporan Collecting Day</title>
        <link rel="stylesheet" type="text/css" href="<?php echo base_url();?>system/css/style2.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo base_url();?>system/css/tabel.css" />
    </head>
    <body>
        <table border="0">
            <tr bgcolor="#cccccc">
                <td colspan="6" align="center"><strong><font size="+1">Laporan Collecting Day</font></strong></td>
            </tr>
            <tr bgcolor="#cccccc">
                <td colspan="6" align="center"><strong><font size="+1">Periode <?php echo indo_tgl($awal)?> s.d <?php echo indo_tgl($akhir)?></font></strong></td>
            </tr>
        </table>
        <div class="data-list">
           <table class="tabel">
                <tr>
                    <th>No</th>
                    <th>Kegiatan</th>
                    <th>Tanggal</th>
                    <th>Petugas</th>
                    <th>Lokasi</th>
                    <th>Total (Rp.)</th>
                </tr>
                <?php
                    $offsets = isset ($offset)?$offset:0;
                    $no = 1 + $offsets;
                    foreach ($data as $row){
                ?>
                <tr class="<?php echo ($no%2)?"even":"odd";?>">
                    <td align="center" style="width: 5%"><?php echo $no++?></td>
                    <td><?php echo $row['kegiatan'];?></td>
                    <td><?php echo datefmysql($row['tanggal']);?></td>
                    <td><?php echo $row['member'];?></td>
                    <td><?php echo $row['lokasi'];?></td>
                    <td align="right"><?php echo rupiah($row['total']);?></td>
                </tr>
                <?php
                    }
                ?>
           </table>
        </div>
    </body>
</html>  